package com.wq.wrongquestion.serviceimpl.mat;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wq.wrongquestion.entity.mat.MathsEntity;
import com.wq.wrongquestion.mapper.mat.MathsMapper;
import com.wq.wrongquestion.service.mat.MathsService;

@Component
public class MathsServiceImpl implements MathsService{

    @Autowired
    public MathsMapper mathsMapper;
    @Override
    @Transactional
    public String getMathsZjnm(String zjID) {
        String zjNm=mathsMapper.getMathsZjnm(zjID);
        return zjNm;
    }
    @Override
    @Transactional
    public List<String> getMathsZjID() {
       List<String> allZjID=mathsMapper.getMathsZjID();
       return allZjID;
    }
    @Override
    @Transactional
    public List<String> getMathsZj() {
        List<String> zjInfo=mathsMapper.getMathsZj();
        return zjInfo;
    }
    @Override
    @Transactional
    public void insMaths(MathsEntity mathsEntity) {
        mathsMapper.insMaths(mathsEntity);
    }
    @Override
    @Transactional
    public PageInfo<MathsEntity> getMaths(Integer pageNumer,Integer pageSize,MathsEntity mathsEntity) {
        PageHelper.startPage(pageNumer, pageSize);
        List<MathsEntity> maths=mathsMapper.getMaths(mathsEntity);
        PageInfo<MathsEntity> pageMaths=new PageInfo<>(maths);
        return pageMaths;
    }

    @Override
    @Transactional
    public List<MathsEntity> getMathsByID(Integer id) {
        List<MathsEntity> maths=mathsMapper.getMathsByID(id);
        return maths;
    }
    @Override
    @Transactional
    public Integer updMaths(MathsEntity mathsEntity) {
        return mathsMapper.updMaths(mathsEntity);
    }
    @Override
    @Transactional
    public Integer delMaths(Integer id) {
        return mathsMapper.delMaths(id);
    }
    
}
